const joi = require('joi');

const account = joi.string().alphanum().min(6).max(12).required();
const password = joi.string().pattern(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,12}$/).required();
const identify = joi.number().required();
const name = joi.string().required();
const sex = joi.number();
const status = joi.number();
const create_time = joi.string();
const update_time = joi.string();
const id = joi.string();

exports.resgister_limit = {
  body: {
    account,
    password,
    identify,
    name,
    sex,
    status,
    create_time,
    update_time
  }
}

exports.login_limit = {
  body: {
    account,
    password,
  }
}